<? if( $_SESSION[ "JC_account_authority" ] ) { ?>

	<? $JC_select = JC_select( ); ?>

	<table>

		<tr>

			<? if( $_REQUEST[ "JC_table" ] == "file" ) { ?>

				<th>File</th>

			<? } ?>

			<? foreach( $_SESSION[ "JC_scheme" ][ $_REQUEST[ "JC_table" ] ] as $key => $value ) { ?>

				<? if( $key == "comment"															) continue; ?>
				<? if( $_SESSION[ "JC_filter_omit_" . $_REQUEST[ "JC_table" ] . "." . $key ]	) continue; ?>

				<th><?= JC_TH( $key ) ?></th>

			<? } ?>

		</tr>



		<? if( $JC_select ) while( $record = $JC_select -> fetch_array( ) ) { ?>

			<tr>

				<? if( $_REQUEST[ "JC_table" ] == "file" ) { ?>

					<td>

						<? if( strpos( $record[ "type" ], "image" ) !== false ) { $host = JC_TA( $record[ "host" ], null, "\r\n" ); ?>

							<a href="<?= $JC_host[ $host[ 0 ] ][ "folder" ] . "/" . $record[ "name" ] ?>" target="JC_file"><img src="<?= $JC_host[ $host[ 0 ] ][ "folder" ] . "/" . $record[ "name" ] ?>" style="width: 60px;" /></a>

						<? } ?>

					</td>

				<? } ?>

				<form id="JC_update_form_<?= $record[ "key" ] ?>" target="JC_asynchronous" method="post">

					<input type="hidden" name="JC_query"			value="update"								/>
					<input type="hidden" name="JC_table"			value="<?= $_REQUEST[ "JC_table" ] ?>"	/>
					<input type="hidden" name="JC_update_key"	value="<?= $record[ "key" ] ?>"				/>

					<? foreach( $_SESSION[ "JC_scheme" ][ $_REQUEST[ "JC_table" ] ] as $key => $value ) { ?>

						<? if( $key == "comment"															) continue; ?>
						<? if( $_SESSION[ "JC_filter_omit_" . $_REQUEST[ "JC_table" ] . "." . $key ]	) continue; ?>



						<? if( strpos( $value[ "type" ], "int" ) !== false || strpos( $value[ "type" ], "float" ) !== false ) { // Integer & Float ?>

							<td class="right form"><?= number_format( $record[ $key ] ) ?></td>

						<? } ?>



						<? if( strpos( $value[ "type" ], "char" ) !== false || strpos( $value[ "type" ], "date" ) !== false ) { // Character & Date ?>

							<td class="form"><?= $record[ $key ] ?></td>

						<? } ?>



						<? if( $value[ "type" ] == "text" ) { // Text ?>

							<td><?= str_replace( $record[ $key ], "\r\n", "<br />" ) ?></td>

						<? } ?>

						<? if( strpos( $key, " FKF" ) ) { // Foreigh Key Field ?>

							<td><?= str_replace( $record[ $key ], "\r\n", "<br />" ) ?></td>

						<? } ?>



					<? } ?>



				</form>

			<tr>

		<? } ?>

	</table><hr />

<? } ?>
